<!-- 页面 -->
<template>
	<view class="ss-goods-wrap">
		<!-- xs卡片：横向紧凑型，一行放两个，图片左内容右边  -->
		<view v-if="size === 'xs'" class="xs-goods-card ss-flex ss-col-stretch" :style="[elStyles]" @tap="onClick">
			<view v-if="tagStyle.show" class="tag-icon-box">
				<image class="tag-icon" :src="sheep.$url.cdn(tagStyle.src)"></image>
			</view>
			<image class="xs-img-box" :src="sheep.$url.cdn(data.image)" mode="aspectFill"></image>
			<view v-if="goodsFields.title?.show || goodsFields.price?.show"
				class="xs-goods-content ss-flex-col ss-row-around">
				<view v-if="goodsFields.title?.show" class="xs-goods-title ss-line-1"
					:style="[{ color: titleColor, width: titleWidth ? titleWidth + 'rpx' : '' }]">
					{{ data.title }}
				</view>
				<view v-if="goodsFields.price?.show" class="xs-goods-price"
					:style="[{ color: goodsFields.price.color }]">
					<text class="price-unit ss-font-24">{{ priceUnit }}</text>
					{{ isArray(data.price) ? data.price[0] : data.price }}
				</view>
			</view>
		</view>

		<!-- sm卡片：竖向紧凑，一行放三个，图上内容下 -->
		<view v-if="size === 'sm'" class="sm-goods-card ss-flex-col" :style="[elStyles]" @tap="onClick">
			<view v-if="tagStyle.show" class="tag-icon-box">
				<image class="tag-icon" :src="sheep.$url.cdn(tagStyle.src)"></image>
			</view>
			<image class="sm-img-box" :src="sheep.$url.cdn(data.image)" mode="aspectFill"></image>

			<view v-if="goodsFields.title?.show || goodsFields.price?.show" class="sm-goods-content"
				:style="[{ color: titleColor, width: titleWidth ? titleWidth + 'rpx' : '' }]">
				<view v-if="goodsFields.title?.show" class="sm-goods-title ss-line-1 ss-m-b-16">
					{{ data.title }}
				</view>
				<view v-if="goodsFields.price?.show" class="sm-goods-price"
					:style="[{ color: goodsFields.price.color }]">
					<text class="price-unit ss-font-24">{{ priceUnit }}</text>
					{{ isArray(data.price) ? data.price[0] : data.price }}
				</view>
			</view>
		</view>

		<!-- md卡片：竖向，一行放两个，图上内容下 -->
		<view v-if="size === 'md'" class="md-goods-card ss-flex-col" :style="[elStyles]" @tap="onClick">
			<view v-if="tagStyle.show" class="tag-icon-box">
				<image class="tag-icon" :src="sheep.$url.cdn(tagStyle.src)"></image>
			</view>
			<image v-if="data.image_wh" class="md-img-box" :src="sheep.$url.cdn(data.image)" mode="widthFix" />
			<image v-else class="md-img-box" :src="sheep.$url.cdn(data.image)"
				:style="[{ height: defaultImgWidth + 'px' }]" mode="aspectFill" />
			<view style="padding-bottom: 0"
				class="md-goods-content ss-flex-col ss-row-around ss-p-b-20 ss-p-t-12 ss-p-x-16" :id="elId">
				<view v-if="goodsFields.title?.show" class="md-goods-title ss-line-1 "
					:style="[{ color: titleColor, width: titleWidth ? titleWidth + 'rpx' : '' }]">
					<text class="title-tag" v-if="goodsType && goodsType.name" :style="{backgroundColor:goodsType.color}">{{ goodsType.name }}</text>
					<text>{{ data.title }}</text>
				</view>
				<!-- <view
          v-if="goodsFields.subtitle?.show"
          class="md-goods-subtitle ss-m-t-16 ss-line-1"
          :style="[{ color: subTitleColor, background: subTitleBackground }]"
        >
          {{ data.subtitle }}
        </view> -->
				<slot name="activity">
					<view v-if="data.promos?.length" class="tag-box ss-flex-wrap ss-flex ss-col-center">
						<view class="activity-tag ss-m-r-10 ss-m-t-16" v-for="item in data.promos" :key="item.id">
							{{ item.title }}
						</view>
					</view>
				</slot>
				<view class="ss-flex ss-col-center ss-m-t-16 ss-m-b-6">
					<view v-if="goodsFields.price?.show" class="md-goods-price ss-m-r-12"
						:style="[{ color: goodsFields.price.color }]">
						<text class="price-unit-s" style="
                font-weight: bold;
                color: #ee3f39;
                margin-right: 0rpx;
              ">{{ priceUnit }}</text>
						<text class="font-ali-bold" style="
                font-size: 34rpx;
                font-weight: bold;
                color: #ee3f39;
              ">
							{{ isArray(data.price) ? data.price[0] : data.price }}</text>
						<!-- <text style="font-weight: bold;color:#e1212b;font-family: Microsoft YaHei">起</text> -->
					</view>

					<!-- <view
            v-if="goodsFields.original_price?.show && data.original_price > 0"
            class="goods-origin-price ss-m-t-16 font-OPPOSANS ss-flex"
            :style="[{ color: originPriceColor }]"
          >
            <text class="price-unit ss-font-20">{{ priceUnit }}</text>
            <view class="ss-m-l-8">{{ data.original_price }}</view>
          </view> -->
					<view v-if="goodsFields.original_price?.show"
						class="goods-origin-price goods-origin-price-seckill ss-flex ss-col-bottom"
						:style="[{ color: originPriceColor }]">
						<view class="font-ali-bold" style="color: #9c9c9c; font-size: 20rpx">原价￥{{data.original_price}}
						</view>
					</view>
				</view>

				<!-- <view class="ss-m-t-16 ss-flex ss-col-center ss-flex-wrap">
          <view class="sales-text">{{ salesAndStock }}</view>
        </view> -->
			</view>
			<view style="width: 100%; height: 2rpx; background: #f1f1f1; margin: 10rpx 0"></view>

			<slot name="cart">
				<view style="
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 12rpx 10rpx 12rpx;
          ">
					<view class="" style="
              background: #f1f1f1;
              padding: 4rpx 16rpx;
              border-radius: 24rpx;
              display: flex;
              justify-content: center;
              align-items: center;
            " @tap.stop="share(data)">
						<image style="width: 32rpx; height: 32rpx" src="/static/share-icon.png" mode="aspectFill">
						</image>
					</view>
					<view class="md-buy-box ss-flex ss-col-center ss-row-center" @tap.stop="addCarClick(data)" v-if="buttonShow">
						<image style="width: 100%; height: 100%" src="/static/icon/cart.png"></image>
					</view>
				</view>
			</slot>
		</view>

		<!-- lg卡片：横向型，一行放一个，图片左内容右边  -->
		<view v-if="size === 'lg'" class="lg-goods-card ss-flex ss-col-stretch" :style="[elStyles]" @tap="onClick">
			<view v-if="tagStyle.show" class="tag-icon-box">
				<image class="tag-icon" :src="sheep.$url.cdn(tagStyle.src)"></image>
			</view>
			<view v-if="seckillTag" class="seckill-tag ss-flex ss-row-center"> 秒杀 </view>
			<view v-if="grouponTag" class="groupon-tag ss-flex ss-row-center">
				<view class="tag-icon">拼团</view>
			</view>
			<image class="lg-img-box" :src="sheep.$url.cdn(data.image)" mode="aspectFill"></image>
			<view class="lg-goods-content ss-flex-1 ss-flex-col ss-row-between">
				<view>
					<view v-if="goodsFields.title?.show" class="lg-goods-title ss-line-1"
						:style="[{ color: titleColor }]">
						<text class="title-tag" :style="{backgroundColor:goodsType.color}">{{ goodsType.name }}</text>
						<text>{{ data.title }}</text>
					</view>
					<view v-if="goodsFields.subtitle?.show" class="lg-goods-subtitle ss-m-t-10 ss-line-1"
						:style="[{ color: subTitleColor, background: subTitleBackground }]">
						{{ data.subtitle }}
					</view>
				</view>

				<view class="progress-wrap ss-flex">
					<view class="progress" :style="{ width: percent < 25 ? '25%' : percent + '%' }">
						{{percent < 30 ? percent+'%':`已抢${percent}%`}}
					</view>
					<view class="progress-label ss-flex-1">{{ percent > 75 ? '':'秒杀中' }}</view>
				</view>

				<view>
					<slot name="activity">
						<view v-if="data.promos?.length" class="tag-box ss-flex ss-col-center">
							<view class="activity-tag ss-m-r-10" v-for="item in data.promos" :key="item.id">
								{{ item.title }}
							</view>
						</view>
					</slot>
					<view class="ss-flex ss-col-bottom ss-m-t-10">
						<view v-if="goodsFields.price?.show" class="lg-goods-price ss-m-r-12"
							:style="[{ color: goodsFields.price.color }]">
							<text class="price-unit-s" style="font-weight: bold; color: #ee3f39;">{{ priceUnit }}</text>
							<text style="font-weight: bold; color: #ee3f39" class="font-ali-bold">{{
                isArray(data.price) ? data.price[0] : data.price
              }}</text>
						</view>
						<!-- <view
              v-if="goodsFields.original_price?.show && data.original_price > 0"
              class="goods-origin-price ss-flex ss-col-bottom font-OPPOSANS"
              :style="[{ color: originPriceColor }]"
            >
              <text class="price-unit ss-font-20">{{ priceUnit }}</text>
              <view class="ss-m-l-8">{{ data.original_price }}</view>
            </view> -->

						<view v-if="goodsFields.original_price?.show"
							class="goods-origin-price goods-origin-price-seckill ss-flex ss-col-bottom"
							:style="[{ color: originPriceColor }]">
							<view class="font-ali-bold" style="color: #9c9c9c; font-size: 20rpx">
								原价￥{{ data.original_price }}</view>
							<!-- <text class="price-unit ss-font-20">{{ priceUnit }}</text>
			        <view class="ss-m-l-8">{{ data.original_price }}</view> -->
						</view>
					</view>
					<view v-if="false" class="ss-m-t-8 ss-flex ss-col-center ss-flex-wrap">
						<view class="sales-text">{{ salesAndStock }}</view>
					</view>
				</view>
			</view>

			<slot name="cart">
				<view class="buy-box ss-flex ss-col-center ss-row-center" v-if="buttonShow"> 去购买 </view>
			</slot>
		</view>

		<!-- sl卡片：竖向型，一行放一个，图片上内容下边 -->
		<view v-if="size === 'sl'" class="sl-goods-card ss-flex-col" :style="[elStyles]" @tap="onClick">
			<view v-if="tagStyle.show" class="tag-icon-box">
				<image class="tag-icon" :src="sheep.$url.cdn(tagStyle.src)"></image>
			</view>

			<image class="sl-img-box" :src="sheep.$url.cdn(data.image)" mode="aspectFill"></image>

			<view class="sl-goods-content">
				<view>
					<view v-if="goodsFields.title?.show" class="sl-goods-title ss-line-1"
						:style="[{ color: titleColor }]">
						{{ data.title }}
					</view>
					<view v-if="goodsFields.subtitle?.show" class="sl-goods-subtitle ss-m-t-16"
						:style="[{ color: subTitleColor, background: subTitleBackground }]">
						{{ data.subtitle }}
					</view>
				</view>
				<view>
					<slot name="activity">
						<view v-if="data.promos?.length" class="tag-box ss-flex ss-col-center ss-flex-wrap">
							<view class="activity-tag ss-m-r-10 ss-m-t-16" v-for="item in data.promos" :key="item.id">
								{{ item.title }}
							</view>
						</view>
					</slot>
					<view v-if="goodsFields.price?.show" class="ss-flex ss-col-bottom">
						<view class="sl-goods-price ss-m-r-12" :style="[{ color: goodsFields.price.color }]">
							<text class="price-unit ss-font-24">{{ priceUnit }}</text>
							{{ isArray(data.price) ? data.price[0] : data.price }}
						</view>
						<view v-if="goodsFields.original_price?.show && data.original_price > 0"
							class="goods-origin-price ss-m-t-16 ss-flex" :style="[{ color: originPriceColor }]">
							<text class="price-unit ss-font-20">{{ priceUnit }}</text>
							<view class="ss-m-l-8">{{ data.original_price }}</view>
						</view>
					</view>
					<view class="ss-m-t-16 ss-flex ss-flex-wrap">
						<view class="sales-text">{{ salesAndStock }}</view>
					</view>
				</view>
			</view>

			<slot name="cart">
				<view class="buy-box ss-flex ss-col-center ss-row-center">去购买</view>
			</slot>
		</view>
	</view>
</template>

<script setup>
	/**
	 * 商品卡片
	 *
	 * @property {Array} size = [xs | sm | md | lg | sl ]        - 列表数据
	 * @property {String} tag                      - md及以上才有
	 * @property {String} img                      - 图片
	 * @property {String} background                  - 背景色
	 * @property {String} topRadius                  - 上圆角
	 * @property {String} bottomRadius                  - 下圆角
	 * @property {String} title                    - 标题
	 * @property {String} titleColor                  - 标题颜色
	 * @property {Number} titleWidth = 0                - 标题宽度，默认0，单位rpx
	 * @property {String} subTitle                    - 副标题
	 * @property {String} subTitleColor                  - 副标题颜色
	 * @property {String} subTitleBackground              - 副标题背景
	 * @property {String | Number} price                - 价格
	 * @property {String} priceColor                  - 价格颜色
	 * @property {String | Number} originPrice              - 原价/划线价
	 * @property {String} originPriceColor                - 原价颜色
	 * @property {String | Number} sales                - 销售数量
	 * @property {String} salesColor                  - 销售数量颜色
	 *
	 * @slots activity                          - 活动插槽
	 * @slots cart                            - 购物车插槽，默认包含文字，背景色，文字颜色 || 图片 || 行为
	 *
	 * @event {Function()} click                    - 点击卡片
	 *
	 */
	import {
		computed,
		getCurrentInstance,
		nextTick,
		onMounted,
		ref
	} from 'vue';
	import sheep from '@/sheep';
	import {
		formatSales,
		formatStock
	} from '@/sheep/hooks/useGoods';
	import {
		isArray
	} from 'lodash';
  import {
    showShareModal
  } from '@/sheep/hooks/useModal';

	// 数据
	let defaultImgWidth = ref(0);

	// 接收参数
	const props = defineProps({
		goodsFields: {
			type: [Array, Object],
			default () {
				return {
					title: {
						show: true,
					},
					subtitle: {
						show: true,
					},
					price: {
						show: true,
					},
					original_price: {
						show: true,
					},
					sales: {
						show: true,
					},
					stock: {
						show: true,
					},
				};
			},
		},
		tagStyle: {
			type: Object,
			default: {},
		},
		data: {
			type: Object,
			default: {},
		},
		size: {
			type: String,
			default: 'sl',
		},
		background: {
			type: String,
			default: '',
		},
		topRadius: {
			type: Number,
			default: 0,
		},
		bottomRadius: {
			type: Number,
			default: 0,
		},
		titleWidth: {
			type: Number,
			default: 0,
		},
		titleColor: {
			type: String,
			default: '#333',
		},
		priceColor: {
			type: String,
			default: '',
		},
		originPriceColor: {
			type: String,
			default: '#C4C4C4',
		},
		priceUnit: {
			type: String,
			default: '￥',
		},
		subTitleColor: {
			type: String,
			default: '#999999',
		},
		subTitleBackground: {
			type: String,
			default: '',
		},
		buttonShow: {
			type: Boolean,
			default: true,
		},
		seckillTag: {
			type: Boolean,
			default: false,
		},
		grouponTag: {
			type: Boolean,
			default: false,
		},
	});



	const goodsType = computed(() => {
		const type = sheep.$store('goods').type;
		return type.find((item) => item.id == props.data.isxh);
	});

	const percent = computed(() => {
		const num = props.data.stock + props.data.sales > 0 ?
			(
				(props.data.sales / (props.data.sales + props.data.stock)) *
				100
			).toFixed(2) :
			0;
		return Number(num);
	});

	// 组件样式
	const elStyles = computed(() => {
		return {
			background: props.background,
			'border-top-left-radius': props.topRadius + 'px',
			'border-top-right-radius': props.topRadius + 'px',
			'border-bottom-left-radius': props.bottomRadius + 'px',
			'border-bottom-right-radius': props.bottomRadius + 'px',
		};
	});

	// 格式化销量、库存信息
	const salesAndStock = computed(() => {
		let text = [];
		if (props.goodsFields.sales?.show) {
			text.push(formatSales(props.data.sales_show_type, props.data.sales));
		}
		if (props.goodsFields.stock?.show) {
			text.push(formatStock(props.data.stock_show_type, props.data.stock));
		}
		return text.join(' | ');
	});

	// 返回事件
	const emits = defineEmits(['click', 'getHeight','addCarClick','shareTap']);

	const onClick = () => {
		emits('click');
	};
	//添加购物车
	const addCarClick = (item) => {

		emits('addCarClick',props.data)
	}
	//分享
	async function share() {
		  console.log(props.data,'props')
	  const shareInfo =
	      sheep.$platform.share.getShareInfo({
	        title: props.data.title,
	        image: sheep.$url.cdn(props.data.image),
	        desc: props.data.subtitle,
	        params: {
	          page: '2',
	          query: props.data.id,
	        },
	      }, {
	        type: 'goods', // 商品海报
	        title: props.data.title, // 商品标题
	        image: sheep.$url.cdn(props.data.image), // 商品主图
	        price: props.data.price, // 商品价格
	        original_price: props.data.original_price, // 商品原价
	      },);
	  await sheep.$platform.share.updateShareInfo(shareInfo);
	  
	  emits('shareTap',shareInfo)
	  showShareModal();
	}
	// 获取卡片实时高度
	const {
		proxy
	} = getCurrentInstance();
	const elId = `sheep_${Math.ceil(Math.random() * 10e5).toString(36)}`;

	function getGoodsPriceCardWH() {
		if (props.size === 'md') {
			const view = uni.createSelectorQuery().in(proxy);
			view.select(`#${elId}`).fields({
				size: true,
				scrollOffset: true,
			});
			view.exec((data) => {
				
				let totalHeight = 0;
				const goodsPriceCard = data[0];
				defaultImgWidth.value = data[0].width || 200;
				if (props.data.image_wh && Number(props.data.image_wh.w)) {
					totalHeight =
						(goodsPriceCard.width / props.data.image_wh.w) * props.data.image_wh.h +
						goodsPriceCard.height;
				} else {
					totalHeight = goodsPriceCard.width + goodsPriceCard.height;
				}
				emits('getHeight', totalHeight);
			});
		}
	}
	onMounted(() => {
		nextTick(() => {
			getGoodsPriceCardWH();
		});
	});
</script>

<style lang="scss" scoped>
	.tag-icon-box {
		position: absolute;
		left: 0;
		top: 0;
		z-index: 2;

		.tag-icon {
			width: 72rpx;
			height: 44rpx;
		}
	}

	.seckill-tag {
		position: absolute;
		left: 0;
		top: 0;
		z-index: 2;
		width: 68rpx;
		height: 38rpx;
		background: linear-gradient(90deg, #ff5854 0%, #ff2621 100%);
		border-radius: 10rpx 0px 10rpx 0px;
		font-size: 24rpx;
		font-weight: 500;
		color: #ffffff;
		line-height: 32rpx;
	}

	.groupon-tag {
		position: absolute;
		left: 0;
		top: 0;
		z-index: 2;
		width: 68rpx;
		height: 38rpx;
		background: linear-gradient(90deg, #fe832a 0%, #ff6600 100%);
		border-radius: 10rpx 0px 10rpx 0px;
		font-size: 24rpx;
		font-weight: 500;
		color: #ffffff;
		line-height: 32rpx;
	}

	.goods-img {
		width: 100%;
		height: 100%;
		background-color: #f5f5f5;
	}

	.price-unit {
		margin-right: -4px;
		font-weight: bold;
	}

	.sales-text {
		display: table;
		font-size: 24rpx;
		transform: scale(0.8);
		margin-left: 0rpx;
		color: #c4c4c4;
	}

	.activity-tag {
		font-size: 20rpx;
		color: #ff0000;
		line-height: 30rpx;
		padding: 0 10rpx;
		border: 1px solid rgba(#ff0000, 0.25);
		border-radius: 4px;
		flex-shrink: 0;
	}

	.goods-origin-price {
		font-size: 20rpx;
		color: #c4c4c4;
		line-height: 1;
		// text-decoration: line-through;
	}

	.goods-origin-price-seckill {
		background: #f1f1f1;
		padding: 5rpx 10rpx;
		border-radius: 16rpx;
		position: relative;
	}

	// xs
	.xs-goods-card {
		overflow: hidden;
		// max-width: 375rpx;
		background-color: $white;
		position: relative;

		.xs-img-box {
			width: 128rpx;
			height: 128rpx;
			margin-right: 20rpx;
			border-radius: 10rpx;
		}

		.xs-goods-title {
			font-size: 26rpx;
			color: #333;
			font-weight: 500;
		}

		.xs-goods-price {
			font-size: 30rpx;
			color: $red;
		}
	}

	// sm
	.sm-goods-card {
		overflow: hidden;
		// width: 223rpx;
		// width: 100%;
		background-color: $white;
		position: relative;

		.sm-img-box {
			// width: 228rpx;
			width: 100%;
			height: 208rpx;
		}

		.sm-goods-content {
			padding: 20rpx 16rpx;
			box-sizing: border-box;
		}

		.sm-goods-title {
			font-size: 26rpx;
			color: #333;
		}

		.sm-goods-price {
			font-size: 30rpx;
			color: $red;
		}
	}

	// md
	.md-goods-card {
		overflow: hidden;
		width: 100%;
		position: relative;
		z-index: 1;
		background-color: $white;
		position: relative;
		box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);

		.md-img-box {
			width: 100%;
		}

		.md-goods-title {
			font-size: 28rpx;
			font-weight: bold;
			color: #333;
			width: 100%;
			position: relative;
			//padding-left: 54rpx;
			overflow: hidden;
			box-sizing: border-box;

			//line-height: 1.3;
			//height: 64rpx;
			//&:before {
			//  content: '现货';
			//  position: absolute;
			//  left: 0;
			//  top: 2rpx;
			//  background: #5acd30;
			//  padding: 0rpx 4rpx;
			//  font-size: 20rpx;
			//  color: #fff;
			//  border-radius: 8rpx;
			//  line-height: 1.5;
			//}
			.title-tag {
				background: #5acd30;
				padding: 2rpx 4rpx;
				font-size: 18rpx;
				color: #fff;
				border-radius: 10rpx;
				vertical-align: middle;
				margin-right: 4rpx;
			}

			>text {
				vertical-align: middle;
			}
		}

		.md-origin-price {
			display: flex;
			margin: 4rpx 0 0 0;
		}

		.md-origin-price-wrap {
			background: #f1f1f1;
			padding: 4rpx 10rpx;
			border-radius: 32rpx;
			position: relative;
			top: 6rpx;
			color: #999;
			font-size: 20rpx;
		}

		.md-goods-subtitle {
			font-size: 24rpx;
			font-weight: 400;
			color: #999999;
		}

		.md-goods-price {
			font-size: 30rpx;
			color: $red;
			line-height: 36rpx;
		}

		.cart-box {
			width: 54rpx;
			height: 54rpx;
			background: linear-gradient(90deg, #fe8900, #ff5e00);
			border-radius: 50%;
			position: absolute;
			bottom: 50rpx;
			right: 20rpx;
			z-index: 2;

			.cart-icon {
				width: 30rpx;
				height: 30rpx;
			}
		}

		.md-buy-box {
			z-index: 2;
			width: 60rpx;
			height: 60rpx;
			overflow: hidden;
			color: #ffffff;
		}
	}

	// lg
	.lg-goods-card {
		overflow: hidden;
		position: relative;
		z-index: 1;
		background-color: $white;
		height: 200rpx;

		.lg-img-box {
			width: 200rpx;
			height: 200rpx;
			margin-right: 20rpx;
			border-radius: 16rpx;
		}

		.lg-goods-title {
			font-size: 28rpx;
			font-weight: 500;
			color: #333333;

			// line-height: 36rpx;
			// width: 410rpx;
			//position: relative;
			//padding-left: 54rpx;
			//&:before {
			//  content: '现货';
			//  position: absolute;
			//  left: 0;
			//  top: 6rpx;
			//  background: #5acd30;
			//  padding: 0 4rpx;
			//  font-size: 20rpx;
			//  color: #fff;
			//  border-radius: 8rpx;
			//}
			.title-tag {
				background: #5acd30;
				padding: 2rpx 4rpx;
				font-size: 18rpx;
				color: #fff;
				border-radius: 10rpx;
				vertical-align: middle;
				margin-right: 4rpx;
			}

			>text {
				vertical-align: middle;
			}
		}

		.lg-goods-subtitle {
			font-size: 24rpx;
			font-weight: 400;
			color: #999999;
			// line-height: 30rpx;
			// width: 410rpx;
		}

		.progress-wrap {
			background: #f0f0f0;
			width: 270rpx;
			height: 32rpx;
			border-radius: 24rpx;
			overflow: hidden;
			display: flex;
			align-items: stretch;
			margin-top: 4rpx;

			.progress {
				background: #f74f3a;
				color: #fff;
				font-size: 20rpx;
				display: flex;
				align-items: center;
				justify-content: center;
			}

			.progress-label {
				display: flex;
				align-items: center;
				justify-content: center;
				font-size: 20rpx;
				color: #cd5342;
			}
		}

		.lg-goods-price {
			font-size: 34rpx;
			color: $red;
			line-height: 36rpx;
			font-weight: bold;
		}

		.buy-box {
			position: absolute;
			bottom: 20rpx;
			right: 20rpx;
			z-index: 2;
			width: 120rpx;
			height: 50rpx;
			background: linear-gradient(90deg, #fe8900, #ff5e00);
			border-radius: 25rpx;
			font-size: 24rpx;
			color: #ffffff;
		}

		.tag-box {
			width: 100%;
		}
	}

	// sl

	.sl-goods-card {
		overflow: hidden;
		position: relative;
		z-index: 1;
		width: 100%;
		background-color: $white;

		.sl-goods-content {
			padding: 20rpx 20rpx;
			box-sizing: border-box;
		}

		.sl-img-box {
			width: 100%;
			height: 360rpx;
		}

		.sl-goods-title {
			font-size: 26rpx;
			color: #333;
			font-weight: 500;
		}

		.sl-goods-subtitle {
			font-size: 24rpx;
			font-weight: 400;
			color: #999999;
			line-height: 30rpx;
		}

		.sl-goods-price {
			font-size: 30rpx;
			color: $red;
			line-height: 36rpx;
		}

		.buy-box {
			position: absolute;
			bottom: 20rpx;
			right: 20rpx;
			z-index: 2;
			width: 148rpx;
			height: 50rpx;
			background: linear-gradient(90deg, #fe8900, #ff5e00);
			border-radius: 25rpx;
			font-size: 24rpx;
			color: #ffffff;
		}
	}
</style>
